#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2025/7/13 1:48
# @Author : liuqi
# @File : config.py
# @Software: PyCharm
# @Describe:
import logging
from datetime import timedelta

from redis import StrictRedis


class ProductionConfig(object):
    # mysql数据库配置
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:latiao%400121@127.0.0.1:3306/info36"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # redis配置
    REDIS_HOST = '192.168.75.130'
    REDIS_PORT = 6379
    # seesion配置信息
    SESSION_TYPE = 'redis'
    # 执行session存储的redis服务器
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    # 设置签名信息
    SESSION_USE_SIGNER = True
    # session的有效期
    PERMANENT_SESSION_LIFETIME = timedelta(days=31)
    # sessionmiyao
    SECRET_KEY = 'latiao@0121'
    # 默认的日志级别
    LEVEL_NAME = logging.INFO

# 开发环境配置信息
class DevelopmentConfig(ProductionConfig):
    pass

# test环境配置信息
class TestingConfig(ProductionConfig):
    pass

# 生产环境配置信息



config_dict = {
    "development":DevelopmentConfig,
    "test":TestingConfig,
    "product":ProductionConfig
}